package com.zy.sing;

/**
 * @Author Gong
 * @Description
 * @dATE 2021/11/22 15:14
 **/
public class ThreadTest extends Thread{
    private String name;

    public ThreadTest(String name) {
        this.name = name;
    }

    @Override
    public void run() {
        System.out.println("----------------------------------------");
        System.out.println("我是线程"+this.name);
        Single instance = Single.getSingleton();
        System.out.println(instance);
        System.out.println("----------------------------------------");
    }

    public static void main(String[] args) {
        ThreadTest thread;
        for (int i = 0; i < 100; i++) {
            thread = new ThreadTest("th"+i);
            thread.start();
        }
    }
}
